FROM java:openjdk-8-jre-alpine

# 设置apk源
RUN echo "http://mirrors.aliyun.com/alpine/v3.5/main" > /etc/apk/repositories \
    && echo -e "http://mirrors.aliyun.com/alpine/v3.5/community" >> /etc/apk/repositories

ENV JHIPSTER_SLEEP 0

# Install base packages 时区
RUN apk update && apk add curl bash tree tzdata \
    && cp -r -f /usr/share/zoneinfo/Hongkong /etc/localtime \
    && echo -ne "Alpine Linux 3.4 image. (`uname -rsv`)\n" >> /root/.built

# add directly the war
ADD *.war /dingding-sonar-app.war

RUN sh -c 'touch /dingding-sonar-app.war'
VOLUME /tmp
EXPOSE 8080
CMD echo "The dingding-sonar-app will start in ${JHIPSTER_SLEEP}s..." && \
    sleep ${JHIPSTER_SLEEP} && \
    java -Djava.security.egd=file:/dev/./urandom -jar ${JAVA_OPTS} /dingding-sonar-app.war
